<h1 class="page-header">
    <small>商品管理</small>
</h1>
<hr/>
<div class="panel panel-inverse" data-sortable-id="form-stuff-5">
    <div class="panel-heading">
        <h4 class="panel-title">商品查询</h4>
    </div>
    <div class="panel-body">
        <form id="goodsForm" name="goodsForm" method="post" class="form-inline">
            <div class="form-group m-r-10">
                <input type="text" class="form-control" name="EQ_id" value="${params.EQ_id}" placeholder="商品ID">
            </div>
            <#if storeId < 1>
            <div class="form-group m-r-10">
                <input type="text" class="form-control" name="EQ_storeId" value="${EQ_storeId}" placeholder="店铺ID">
            </div>
            </#if>
            <div class="form-group m-r-10">
                <input type="text" class="form-control" name="LIKE_name" value="${params.LIKE_name}" placeholder="商品名称">
            </div>
            <div class="form-group m-r-10">
                <input type="text" class="form-control" name="EQ_goodsNo" value="${params.EQ_goodsNo}" placeholder="商品条码">
            </div>
            <div class="form-group m-r-10">
                <select class="form-control" name="EQ_status" id="EQ_status">
                    <option value="">商品状态</option>
                     <option value="A" <#if params.EQ_status== "A"> selected</#if>>上架</option>
                     <option value="D" <#if params.EQ_status== "D"> selected</#if>>下架</option>
                </select>
            </div>
            <button type="button" class="btn btn-sm btn-success m-r-5"
                    onclick="postDataByForm('backend/goods/goods/list', 'displayArea', 'goodsForm')"><i class="fa fa-search"></i>查询
            </button>
            <button type="button" class="btn btn-sm btn-danger m-r-5"
               onclick="getData('${rc.contextPath}/backend/goods/goods/add', 'displayArea')"><i class="fa fa-plus"></i>新增</button>
        </form>
    </div>
</div>
<hr/>
<div class="panel panel-inverse" data-sortable-id="table-basic-4">
    <div class="panel-heading">
        <h4 class="panel-title">商品列表</h4>
    </div>
    <div class="panel-body">
        <table class="table table-striped table-bordered">
            <thead>
            <tr>
                <th>商品ID</th>
                <th>主图</th>
                <th>商品名称</th>
                <th>商品条码</th>
                <th>所属分类</th>
                <#if storeId < 1>
                <th>所属店铺</th>
                </#if>
                <th>价格</th>
                <th>状态</th>
                <th>创建时间</th>
                <th>最后操作人</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <#if paginationResponse?has_content && paginationResponse.content?exists && paginationResponse.content?size gt 0>
                <#list paginationResponse.content as ct>
                    <tr>
                        <td>${ct.id}</td>
                        <td><img class="m-r-20 m-b-10" src="${ct.logo}" style="border:1px solid #cccccc;width:80px;height:60px;border-radius: 5px;"></td>
                        <td>${ct.name}</td>
                        <td>${ct.goodsNo}</td>
                        <td><#if ct.cateInfo>${ct.cateInfo.name}<#else>--</#if></td>
                        <#if storeId < 1>
                           <td><#if ct.storeInfo>${ct.storeInfo.name}<#else>--</#if></td>
                        </#if>
                        <td>${ct.price}</td>
                        <td>
                            <#if ct.status == "A">
                            <span class="status-active">上架</span>
                            <#else>
                            <span class="status-disabled">下架</span>
                           </#if>
                        </td>
                        <td>${ct.createTime}</td>
                        <td>${ct.operator}</td>
                        <td>
                            <a class="label label-success small-btn" href="javascript:getData('${rc.contextPath}/backend/goods/goods/add/?goodsId=${ct.id}','displayArea')"><i class="fa fa-edit"></i>编辑</a>
                        </td>
                    </tr>
                </#list>
            <#else>
            <tr class="gradeA even" role="row">
                <td colspan="12" class="text-center">没有符合条件的数据！</td>
            </tr>
            </#if>
        </table>
    </div>
</div>

<!-- 分页组件 -->
<@sp.pagination recordBean=paginationResponse action="${rc.contextPath}/backend/goods/goods/list" formName="goodsForm"/>